﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
	xmlns:holdem="clr-namespace:Holdem.Core.Controls;assembly=Holdem.Core"
	xmlns:toolkitPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls.Toolkit" 
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" 
    xmlns:controlsPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:eim="clr-namespace:Microsoft.Expression.Interactivity.Media;assembly=Microsoft.Expression.Interactions"
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	xmlns:MvvmLite="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71">

	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="DarkThemeStyle.xaml"/>
        <ResourceDictionary Source="DataStyle.xaml"/>
	</ResourceDictionary.MergedDictionaries>
	
	<!-- ********************************* -->
	<!--    TEXAS HOLDEM STYLE RESOURCES   -->
	<!-- ********************************* -->

    <PlaneProjection x:Name="DefaultProjection" />
    
	<!-- SLIDER STYLE-->
	<Style x:Key="THCMainSlider" TargetType="Slider">
		<Setter Property="Height" Value="84" />
		<Setter Property="Maximum" Value="3" />
		<Setter Property="Minimum" Value="0" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="SmallChange" Value="1" />
		<Setter Property="LargeChange" Value="1" />
	</Style>

	<Style x:Key="THCHistorySlider" TargetType="Slider">
		<Setter Property="Height" Value="84" />
		<Setter Property="Minimum" Value="0" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="SmallChange" Value="1" />
		<Setter Property="LargeChange" Value="1" />
	</Style>

	<!-- CARD IMAGES -->
	<Style x:Key="THCCardStyle" TargetType="Image">
		<Setter Property="HorizontalAlignment" Value="Center" />
		<Setter Property="VerticalAlignment" Value="Center" />
		<Setter Property="Stretch" Value="Fill" />
		<Setter Property="Height" Value="118" />
		<Setter Property="Width" Value="84" />
		<Setter Property="Source" Value="Images/Icons/32/Back.png" />
        <!-- Cause all of the cards to use the same projection -->
        <!--Setter Property="Projection" Value="{StaticResource DefaultProjection}" /-->
	</Style>
    
	<Style x:Key="ButtonOverlayTemplate" TargetType="ContentControl">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ContentControl">
					<ContentPresenter 
							ContentTemplate="{TemplateBinding ContentTemplate}" 
							Content="{TemplateBinding Content}" 
							HorizontalAlignment="Center" 
							VerticalAlignment="Center"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="NoBorderButton" TargetType="Button">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
		<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
		<Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
		<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
		<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Button">
					<Grid Background="Transparent">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <!--<Storyboard x:Name="AnimateCardVertical">
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" 
											Storyboard.TargetName="ButtonBackground">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="90"/>
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="180"/>
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="270"/>
                                            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="360"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>-->
                                </VisualState>
                                    <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed">
                                    <!--<Storyboard x:Name="AnimateCardVerticalHorizontal">
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" 
											Storyboard.TargetName="ButtonBackground">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="90"/>
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="180"/>
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="270"/>
                                            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="360"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>-->
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames 
											Storyboard.TargetProperty="Foreground" 
											Storyboard.TargetName="ContentContainer">
											<DiscreteObjectKeyFrame 
												KeyTime="0" 
												Value="{StaticResource PhoneDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames 
											Storyboard.TargetProperty="BorderBrush" 
											Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame 
												KeyTime="0" 
												Value="{StaticResource PhoneDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames 
											Storyboard.TargetProperty="Background" 
											Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame 
												KeyTime="0" 
												Value="Transparent"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Border x:Name="ButtonBackground" 
							BorderBrush="{TemplateBinding BorderBrush}" 
							Background="{TemplateBinding Background}" 
							CornerRadius="0">
							<Border.Projection>
								<PlaneProjection />
							</Border.Projection>
							<ContentControl x:Name="ContentContainer" 
								ContentTemplate="{TemplateBinding ContentTemplate}" 
								Content="{TemplateBinding Content}" 
								Foreground="{TemplateBinding Foreground}" 
								HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
								Padding="{TemplateBinding Padding}" 
								VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" 
								Style="{StaticResource ButtonOverlayTemplate}"/>
						</Border>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="THCCardOverlayStyle" TargetType="Button" BasedOn="{StaticResource NoBorderButton}" >
		<Setter Property="HorizontalAlignment" Value="Stretch" />
		<Setter Property="VerticalAlignment" Value="Stretch" />
		<Setter Property="Height" Value="118" />
		<Setter Property="Width" Value="84" />
	</Style>


    <Style x:Name="ContextMenuItemStyle" TargetType="toolkit:MenuItem">
        <Setter Property="Background" Value="{StaticResource PhoneAccentColor}" />
        <Setter Property="BorderThickness" Value="5" />
        <Setter Property="BorderBrush" Value="LightBlue" />
    </Style>

    <Style x:Key="RadioButtonListItemContextMenuStyle" TargetType="ListBoxItem">
		<Setter Property="Padding" Value="3" />
		<Setter Property="VerticalContentAlignment" Value="Top" />
		<Setter Property="Background" Value="Transparent" />
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ListBoxItem">
					<Grid Background="{TemplateBinding Background}">
                        <RadioButton  Foreground="{StaticResource PhoneAccentBrush}"
                                      IsChecked="{Binding IsSelected, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" >
                            <RadioButton.Content>
                                <TextBlock Text="{Binding Title}" TextWrapping="Wrap" />
                            </RadioButton.Content>
                            <toolkit:ContextMenuService.ContextMenu>
                                <toolkit:ContextMenu VerticalOffset="-100">
                                    <toolkit:MenuItem Header="Delete" Tag="Delete" Style="{StaticResource ContextMenuItemStyle}" >
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="Click">
                                                <MvvmLite:EventToCommand x:Name="DeleteHandCommand" 
                                                                         Command="{Binding Source={StaticResource Locator}, Path=StartingHands.DeleteHandCommand}" 
                                                                         CommandParameter="{Binding Title}"/>
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </toolkit:MenuItem>
                                </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>
                        </RadioButton>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

    <Style x:Key="RadioButtonListItemStyle" TargetType="ListBoxItem">
        <Setter Property="Padding" Value="3" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Grid Background="{TemplateBinding Background}">
                        <RadioButton  Foreground="{StaticResource PhoneAccentBrush}"
							IsChecked="{Binding IsSelected, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" 
							Content="{TemplateBinding Content}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="THCStartingHandsListBox" TargetType="ListBox">
		<Setter Property="Padding" Value="1"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="{StaticResource THCPhoneForegroundBrush}"/>
		<Setter Property="HorizontalContentAlignment" Value="Left"/>
		<Setter Property="VerticalContentAlignment" Value="Top"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="BorderBrush" Value="{StaticResource THCPhoneForegroundBrush}"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ListBox">
					<Grid>
						<ScrollViewer x:Name="ScrollViewer" 
                                      BorderBrush="{TemplateBinding BorderBrush}" 
                                      BorderThickness="{TemplateBinding BorderThickness}" 
                                      Background="{TemplateBinding Background}" 
                                      Foreground="{TemplateBinding Foreground}" Margin="1" 
                                      Padding="{TemplateBinding Padding}">
							<ItemsPresenter/>
						</ScrollViewer>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="THCRoundTextBlockStyle" TargetType="holdem:RoundTextBox">
		<Setter Property="FontFamily" Value="{StaticResource THCSemiLightFontFamily}" />
		<Setter Property="FontSize" Value="{StaticResource THCHistoryLargeValueFont}"/>
		<Setter Property="VerticalAlignment" Value="Center"/>
		<Setter Property="HorizontalAlignment" Value="Center"/>
		<Setter Property="Foreground" Value="{StaticResource THCChromeBrush}" />
		<Setter Property="Width" Value="150" />
		<Setter Property="Height" Value="55" />
		<Setter Property="Foreground" Value="{StaticResource THCChromeBrush}" />
	</Style>

	<Style x:Key="RoundButtonStyle" TargetType="Button">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Button">
					<Grid Background="Transparent" Width="{Binding Width}" Height="{Binding Height}">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Pressed">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames 
											Storyboard.TargetProperty="BorderBrush" 
											Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame 
													KeyTime="0" 
													Value="{StaticResource PhoneForegroundBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames 
												Storyboard.TargetProperty="BorderBrush" 
												Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame 
													KeyTime="0" 
													Value="{StaticResource PhoneDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Border x:Name="ButtonBackground" 
                                BorderBrush="{StaticResource PhoneAccentBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                Width="{Binding Width}" 
                                Height="{Binding Height}" 
                                CornerRadius="2">
							<ContentControl x:Name="ContentContainer" 
                                            Content="{TemplateBinding Content}" 
                                            HorizontalAlignment="Center" 
                                            VerticalAlignment="Center" />
						</Border>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="RoundButtonCircleStyle" TargetType="Button">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Button">
					<Grid Background="Transparent" Width="{Binding Width}" Height="{Binding Height}">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Pressed">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames 
												Storyboard.TargetProperty="BorderBrush" 
												Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame 
													KeyTime="0" 
													Value="{StaticResource PhoneForegroundBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames 
												Storyboard.TargetProperty="BorderThickness" 
												Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame 
													KeyTime="0" 
													Value="0"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames 
												Storyboard.TargetProperty="BorderBrush" 
												Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame 
													KeyTime="0" 
													Value="{StaticResource PhoneDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Border x:Name="ButtonBackground" 
                                BorderBrush="{StaticResource PhoneAccentBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                CornerRadius="24" 
                                Width="{Binding Width}" 
                                Height="{Binding Width}" 
                                HorizontalAlignment="Center" 
                                VerticalAlignment="Center">
							<ContentControl x:Name="ContentContainer" 
                                            Content="{TemplateBinding Content}"
                                            HorizontalAlignment="Center" 
                                            VerticalAlignment="Center" />
						</Border>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="BorderThickness" Value="3"/>
		<Setter Property="Padding" Value="0"/>
		<Setter Property="Width" Value="100"/>
		<Setter Property="Height" Value="100"/>
		<Setter Property="Margin" Value="0"/>
	</Style>

	<Style x:Key="RoundButtonShortStyle" TargetType="Button">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Button">
					<Grid Background="Transparent">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Pressed">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames 
											Storyboard.TargetProperty="BorderBrush"
											Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame 
												KeyTime="0" 
												Value="{StaticResource PhoneForegroundBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" 
                                                                       Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame KeyTime="0" 
                                                                    Value="{StaticResource PhoneDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Border x:Name="ButtonBackground" 
                                BorderBrush="{StaticResource PhoneAccentBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                CornerRadius="2">
							<ContentControl x:Name="ContentContainer" 
                                            Content="{TemplateBinding Content}" 
                                            HorizontalAlignment="Center" 
                                            VerticalAlignment="Center" />
						</Border>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="OptionsRoundButtonStyle" TargetType="Button">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Button">
					<Grid Background="Transparent">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Pressed">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames 
											Storyboard.TargetProperty="BorderBrush" 
											Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame 
												KeyTime="0" 
												Value="{StaticResource PhoneForegroundBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames 
											Storyboard.TargetProperty="BorderBrush" 
											Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame 
												KeyTime="0" 
												Value="{StaticResource PhoneDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Border x:Name="ButtonBackground" 
                                BorderBrush="{StaticResource PhoneAccentBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                CornerRadius="2">
							<ContentControl x:Name="ContentContainer" 
											Content="{TemplateBinding Content}" 
											HorizontalAlignment="Center" 
											VerticalAlignment="Center" />
						</Border>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="StatsKickerTemplate" TargetType="ListBox">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
		<Setter Property="Padding" Value="0"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ListBox">
					<ScrollViewer x:Name="ScrollViewer" 
                                  BorderBrush="{TemplateBinding BorderBrush}" 
                                  BorderThickness="{TemplateBinding BorderThickness}" 
                                  Background="{TemplateBinding Background}" 
                                  Foreground="{TemplateBinding Foreground}" 
                                  Padding="{TemplateBinding Padding}">
						<ItemsPresenter HorizontalAlignment="Center"/>
					</ScrollViewer>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
    
	<Style x:Key="ScrollViewerStyle1" TargetType="ScrollViewer">
		<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="HorizontalScrollBarVisibility" Value="Disabled"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Padding" Value="0"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ScrollViewer">
					<Border BorderBrush="{TemplateBinding BorderBrush}" 
                            BorderThickness="{TemplateBinding BorderThickness}" 
                            Background="{TemplateBinding Background}">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="ScrollStates">
								<VisualStateGroup.Transitions>
									<VisualTransition GeneratedDuration="00:00:00.5"/>
								</VisualStateGroup.Transitions>
								<VisualState x:Name="Scrolling">
									<Storyboard>
										<DoubleAnimation Duration="0" To="1" 
                                                         Storyboard.TargetProperty="Opacity" 
                                                         Storyboard.TargetName="VerticalScrollBar"/>
										<DoubleAnimation Duration="0" To="1" 
                                                         Storyboard.TargetProperty="Opacity" 
                                                         Storyboard.TargetName="HorizontalScrollBar"/>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Grid Margin="{TemplateBinding Padding}">
							<ScrollContentPresenter x:Name="ScrollContentPresenter" 
                                                    ContentTemplate="{TemplateBinding ContentTemplate}" 
                                                    Content="{TemplateBinding Content}"/>
							<ScrollBar x:Name="VerticalScrollBar" 
                                       HorizontalAlignment="Right" 
                                       Height="Auto" IsHitTestVisible="False" 
                                       IsTabStop="False" 
                                       Maximum="{TemplateBinding ScrollableHeight}" 
                                       Minimum="0" 
                                       Orientation="Vertical" 
                                       Value="{TemplateBinding VerticalOffset}" 
                                       ViewportSize="{TemplateBinding ViewportHeight}" 
                                       VerticalAlignment="Stretch" 
                                       Width="5" 
                                       Background="{StaticResource PhoneAccentBrush}" 
                                       Foreground="{StaticResource PhoneAccentBrush}"/>
							<ScrollBar x:Name="HorizontalScrollBar" 
                                       HorizontalAlignment="Stretch" 
                                       Height="5" IsHitTestVisible="False" 
                                       IsTabStop="False" 
                                       Maximum="{TemplateBinding ScrollableWidth}" 
                                       Minimum="0" 
                                       Opacity="0" 
                                       Orientation="Horizontal" 
                                       Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" 
                                       Value="{TemplateBinding HorizontalOffset}" 
                                       ViewportSize="{TemplateBinding ViewportWidth}" 
                                       VerticalAlignment="Bottom" 
                                       Width="Auto"/>
						</Grid>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="THCStatsKickerListBoxTemplate" TargetType="ListBox">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
		<Setter Property="Padding" Value="0"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ListBox">
					<ScrollViewer x:Name="ScrollViewer" 
									  BorderBrush="{TemplateBinding BorderBrush}" 
									  BorderThickness="{TemplateBinding BorderThickness}" 
									  Background="{TemplateBinding Background}" 
									  Foreground="{TemplateBinding Foreground}" 
									  Padding="{TemplateBinding Padding}" 
									  FontFamily="Segoe WP SemiLight" 
									  FontSize="26.667" 
									  HorizontalAlignment="Center" HorizontalContentAlignment="Stretch" 
                                  Style="{StaticResource ScrollViewerStyle1}">
						<ItemsPresenter HorizontalAlignment="Center"/>
					</ScrollViewer>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="HyperlinkButtonWrappingStyle" TargetType="HyperlinkButton">
		<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
		<Setter Property="Background" Value="Transparent" />
		<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}" />
		<Setter Property="Padding" Value="0" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="HyperlinkButton">
					<Border Background="Transparent">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal" />
								<VisualState x:Name="MouseOver" />
								<VisualState x:Name="Pressed">
									<Storyboard>
										<DoubleAnimation Duration="0" To="0.5" 
															 Storyboard.TargetProperty="Opacity" 
															 Storyboard.TargetName="TextElement" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames 
												Storyboard.TargetProperty="Foreground" 
												Storyboard.TargetName="TextElement">
											<DiscreteObjectKeyFrame 
													KeyTime="0" 
													Value="{StaticResource PhoneDisabledBrush}" />
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Border Background="{TemplateBinding Background}" 
									Margin="{StaticResource PhoneHorizontalMargin}" 
									Padding="{TemplateBinding Padding}">
							<TextBlock x:Name="TextElement" 
										   HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
										   Text="{TemplateBinding Content}" TextDecorations="Underline" 
										   VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
										   TextWrapping="Wrap" />
						</Border>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- ********************************* -->
	<!--   TEXAS HOLDEM CONTROL TEMPLATE   -->
	<!-- ********************************* -->
	
	<ControlTemplate x:Key="PhoneSimpleRepeatButton" TargetType="RepeatButton">
		<Rectangle Fill="Transparent" />
	</ControlTemplate>

	<ControlTemplate x:Key="PhoneSimpleThumb" TargetType="Thumb">
		<Rectangle Fill="Transparent" />
	</ControlTemplate>

	<ControlTemplate x:Key="THCSliderStyle" TargetType="Slider">
		<Grid Background="Transparent">
			<VisualStateManager.VisualStateGroups>
				<VisualStateGroup x:Name="CommonStates">
					<VisualState x:Name="Normal"/>
					<VisualState x:Name="MouseOver"/>
					<VisualState x:Name="Disabled">
						<Storyboard>
							<DoubleAnimation Duration="0" 
												 Storyboard.TargetName="HorizontalTrack" 
												 Storyboard.TargetProperty="Opacity" To="0.1" />
							<DoubleAnimation Duration="0" 
												 Storyboard.TargetName="VerticalTrack" 
												 Storyboard.TargetProperty="Opacity" To="0.1" />
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="HorizontalFill" 
									Storyboard.TargetProperty="Fill">
								<DiscreteObjectKeyFrame 
										KeyTime="0" 
										Value="{StaticResource PhoneDisabledBrush}" />
							</ObjectAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="VerticalFill" 
									Storyboard.TargetProperty="Fill">
								<DiscreteObjectKeyFrame 
										KeyTime="0" 
										Value="{StaticResource PhoneDisabledBrush}" />
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
			</VisualStateManager.VisualStateGroups>
			<Grid x:Name="HorizontalTemplate" Margin="{StaticResource PhoneHorizontalMargin}">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition Width="0"/>
					<ColumnDefinition Width="*"/>
				</Grid.ColumnDefinitions>
				<Rectangle x:Name="HorizontalTrack" 
							   IsHitTestVisible="False" 
							   Fill="{TemplateBinding Background}" 
							   Opacity="0.2" Grid.ColumnSpan="3" 
							   Height="12" Margin="0" VerticalAlignment="Center"/>
				<Rectangle x:Name="HorizontalFill" 
							   IsHitTestVisible="False" 
							   Fill="{TemplateBinding Foreground}" 
							   Grid.Column="0" Height="12" Margin="0" 
							   VerticalAlignment="Center"/>
				<RepeatButton x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" 
								  IsTabStop="False" 
								  Template="{StaticResource PhoneSimpleRepeatButton}" Grid.Column="0" />
				<RepeatButton x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" 
								  IsTabStop="False" 
								  Template="{StaticResource PhoneSimpleRepeatButton}" Grid.Column="2" />
				<Thumb x:Name="HorizontalThumb" Width="1" Margin="0,36,445,36" Grid.Column="2" 
						   BorderBrush="{StaticResource PhoneAccentBrush}" 
						   Foreground="{StaticResource PhoneChromeBrush}" 
						   Background="{StaticResource BlueGradientBrush}" >
					<Thumb.RenderTransform>
						<ScaleTransform ScaleX="20" ScaleY="1"/>
					</Thumb.RenderTransform>
				</Thumb>
			</Grid>
			<Grid x:Name="VerticalTemplate" Margin="{StaticResource PhoneVerticalMargin}">
				<Grid.RowDefinitions>
					<RowDefinition Height="*"/>
					<RowDefinition Height="0"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				<Rectangle x:Name="VerticalTrack" 
							   IsHitTestVisible="False" 
							   Fill="{TemplateBinding Background}" 
							   Opacity="0.2" Grid.RowSpan="3" Width="12" Margin="12,0"/>
				<Rectangle x:Name="VerticalFill" 
							   IsHitTestVisible="False" 
							   Fill="{TemplateBinding Foreground}" Grid.Row="2" Width="12" Margin="12,0"/>
				<RepeatButton x:Name="VerticalTrackLargeChangeDecreaseRepeatButton" 
								  IsTabStop="False" 
								  Template="{StaticResource PhoneSimpleRepeatButton}" Grid.Row="0"/>
				<RepeatButton x:Name="VerticalTrackLargeChangeIncreaseRepeatButton" 
								  IsTabStop="False" 
								  Template="{StaticResource PhoneSimpleRepeatButton}" Grid.Row="2"/>
				<Thumb x:Name="VerticalThumb" Height="1" Margin="0,-1,0,0" Grid.Row="1" 
						   Template="{StaticResource PhoneSimpleThumb}" RenderTransformOrigin="0.5,0.5">
					<Thumb.RenderTransform>
						<ScaleTransform ScaleX="1" ScaleY="32"/>
					</Thumb.RenderTransform>
				</Thumb>
			</Grid>
		</Grid>
	</ControlTemplate>

	<ControlTemplate x:Name="PhoneScrollViewerNoScrollBars" TargetType="ScrollViewer">
		<ScrollContentPresenter x:Name="ScrollContentPresenter" 
									Content="{TemplateBinding Content}" 
									ContentTemplate="{TemplateBinding ContentTemplate}" 
									VerticalAlignment="Center" HorizontalAlignment="Center"/>
	</ControlTemplate>

	<ControlTemplate x:Key="PhoneDisabledTextBoxTemplate" TargetType="TextBox">
		<ScrollViewer x:Name="ContentElement" BorderThickness="0" Padding="{TemplateBinding Padding}" Margin="0"
				Template="{StaticResource PhoneScrollViewerNoScrollBars}"/>
	</ControlTemplate>

	<ControlTemplate x:Key="THCInputTextBoxStyle" TargetType="TextBox">
		<Grid Background="Transparent" Width="{Binding Width}" Height="{Binding Height}">
			<VisualStateManager.VisualStateGroups>
				<VisualStateGroup x:Name="CommonStates">
					<VisualState x:Name="Normal"/>
					<VisualState x:Name="MouseOver"/>
					<VisualState x:Name="Disabled">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="EnabledBorder" 
									Storyboard.TargetProperty="Visibility">
								<DiscreteObjectKeyFrame KeyTime="0">
									<DiscreteObjectKeyFrame.Value>
										<Visibility>Collapsed</Visibility>
									</DiscreteObjectKeyFrame.Value>
								</DiscreteObjectKeyFrame>
							</ObjectAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="DisabledOrReadonlyBorder" 
									Storyboard.TargetProperty="Visibility">
								<DiscreteObjectKeyFrame KeyTime="0">
									<DiscreteObjectKeyFrame.Value>
										<Visibility>Visible</Visibility>
									</DiscreteObjectKeyFrame.Value>
								</DiscreteObjectKeyFrame>
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="ReadOnly">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="EnabledBorder" 
									Storyboard.TargetProperty="Visibility">
								<DiscreteObjectKeyFrame KeyTime="0">
									<DiscreteObjectKeyFrame.Value>
										<Visibility>Collapsed</Visibility>
									</DiscreteObjectKeyFrame.Value>
								</DiscreteObjectKeyFrame>
							</ObjectAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="DisabledOrReadonlyBorder" 
									Storyboard.TargetProperty="Visibility">
								<DiscreteObjectKeyFrame KeyTime="0">
									<DiscreteObjectKeyFrame.Value>
										<Visibility>Visible</Visibility>
									</DiscreteObjectKeyFrame.Value>
								</DiscreteObjectKeyFrame>
							</ObjectAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="DisabledOrReadonlyBorder" 
									Storyboard.TargetProperty="Background">
								<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneSubtleBrush}" />
							</ObjectAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="DisabledOrReadonlyBorder" 
									Storyboard.TargetProperty="BorderBrush">
								<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneSubtleBrush}" />
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
				<VisualStateGroup x:Name="FocusStates">
					<VisualState x:Name="Focused">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="EnabledBorder" 
									Storyboard.TargetProperty="Background">
								<DiscreteObjectKeyFrame 
										KeyTime="0" 
										Value="{StaticResource PhoneContrastBackgroundBrush}" />
							</ObjectAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="EnabledBorder" 
									Storyboard.TargetProperty="BorderBrush">
								<DiscreteObjectKeyFrame 
										KeyTime="0" 
										Value="{StaticResource PhoneContrastBackgroundBrush}" />
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="Unfocused"/>
				</VisualStateGroup>
			</VisualStateManager.VisualStateGroups>
			<Border x:Name="EnabledBorder" 
						Background="{TemplateBinding Background}" 
						BorderThickness="{TemplateBinding BorderThickness}" 
						BorderBrush="{StaticResource PhoneAccentBrush}" CornerRadius="2" >
				<ScrollViewer x:Name="ContentElement" BorderThickness="0" Padding="{TemplateBinding Padding}"
						Template="{StaticResource PhoneScrollViewerNoScrollBars}" />
			</Border>
			<Border x:Name="DisabledOrReadonlyBorder" 
						Visibility="Collapsed" 
						Background="Transparent"
						BorderBrush="{StaticResource PhoneDisabledBrush}" 
						BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"  >
				<TextBox Text="{TemplateBinding Text}" 
							 Background="Transparent" IsReadOnly="True" 
							 SelectionBackground="{TemplateBinding SelectionBackground}" 
							 SelectionForeground="{TemplateBinding SelectionForeground}"
							 TextWrapping="{TemplateBinding TextWrapping}" 
							 TextAlignment="{TemplateBinding TextAlignment}"
							 Foreground="{StaticResource PhoneDisabledBrush}" 
							 Template="{StaticResource PhoneDisabledTextBoxTemplate}"/>
			</Border>
		</Grid>
	</ControlTemplate>

	<ControlTemplate x:Key="THCStatsInputTextBoxStyle" TargetType="TextBox">
		<Grid Background="Transparent" Width="133" Height="48">
			<VisualStateManager.VisualStateGroups>
				<VisualStateGroup x:Name="CommonStates">
					<VisualState x:Name="Normal"/>
					<VisualState x:Name="MouseOver"/>
					<VisualState x:Name="Disabled">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="EnabledBorder" 
									Storyboard.TargetProperty="Visibility">
								<DiscreteObjectKeyFrame KeyTime="0">
									<DiscreteObjectKeyFrame.Value>
										<Visibility>Collapsed</Visibility>
									</DiscreteObjectKeyFrame.Value>
								</DiscreteObjectKeyFrame>
							</ObjectAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="DisabledOrReadonlyBorder" 
									Storyboard.TargetProperty="Visibility">
								<DiscreteObjectKeyFrame KeyTime="0">
									<DiscreteObjectKeyFrame.Value>
										<Visibility>Visible</Visibility>
									</DiscreteObjectKeyFrame.Value>
								</DiscreteObjectKeyFrame>
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="ReadOnly">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="EnabledBorder" 
									Storyboard.TargetProperty="Visibility">
								<DiscreteObjectKeyFrame KeyTime="0">
									<DiscreteObjectKeyFrame.Value>
										<Visibility>Collapsed</Visibility>
									</DiscreteObjectKeyFrame.Value>
								</DiscreteObjectKeyFrame>
							</ObjectAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="DisabledOrReadonlyBorder" 
									Storyboard.TargetProperty="Visibility">
								<DiscreteObjectKeyFrame KeyTime="0">
									<DiscreteObjectKeyFrame.Value>
										<Visibility>Visible</Visibility>
									</DiscreteObjectKeyFrame.Value>
								</DiscreteObjectKeyFrame>
							</ObjectAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="DisabledOrReadonlyBorder" 
									Storyboard.TargetProperty="Background">
								<DiscreteObjectKeyFrame 
										KeyTime="0" 
										Value="{StaticResource PhoneSubtleBrush}" />
							</ObjectAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="DisabledOrReadonlyBorder" 
									Storyboard.TargetProperty="BorderBrush">
								<DiscreteObjectKeyFrame 
										KeyTime="0" 
										Value="{StaticResource PhoneSubtleBrush}" />
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
				<VisualStateGroup x:Name="FocusStates">
					<VisualState x:Name="Focused">
						<Storyboard>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="EnabledBorder" 
									Storyboard.TargetProperty="Background">
								<DiscreteObjectKeyFrame 
										KeyTime="0" 
										Value="{StaticResource PhoneContrastBackgroundBrush}" />
							</ObjectAnimationUsingKeyFrames>
							<ObjectAnimationUsingKeyFrames 
									Storyboard.TargetName="EnabledBorder" 
									Storyboard.TargetProperty="BorderBrush">
								<DiscreteObjectKeyFrame 
										KeyTime="0" 
										Value="{StaticResource PhoneContrastBackgroundBrush}" />
							</ObjectAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="Unfocused"/>
				</VisualStateGroup>
			</VisualStateManager.VisualStateGroups>
			<Border x:Name="EnabledBorder" 
						Background="{TemplateBinding Background}" 
						BorderThickness="{TemplateBinding BorderThickness}" 
						BorderBrush="{StaticResource PhoneAccentBrush}" CornerRadius="10" >
				<ScrollViewer x:Name="ContentElement" BorderThickness="0" Padding="{TemplateBinding Padding}"
						Template="{StaticResource PhoneScrollViewerNoScrollBars}" />
			</Border>
			<Border x:Name="DisabledOrReadonlyBorder" Visibility="Collapsed" 
						Background="Transparent" CornerRadius="10" Width="150" Height="55"
						BorderBrush="{StaticResource PhoneDisabledBrush}" 
						BorderThickness="{TemplateBinding BorderThickness}"  >
				<TextBox Text="{TemplateBinding Text}" 
							 Background="Transparent" IsReadOnly="True" 
							 SelectionBackground="{TemplateBinding SelectionBackground}" 
							 SelectionForeground="{TemplateBinding SelectionForeground}"
							 TextWrapping="{TemplateBinding TextWrapping}" 
							 TextAlignment="{TemplateBinding TextAlignment}"
							 Foreground="{StaticResource PhoneDisabledBrush}" 
							 Template="{StaticResource PhoneDisabledTextBoxTemplate}"/>
			</Border>
		</Grid>
	</ControlTemplate>

    <!-- ********************************* -->
    <!--   TEXAS HOLDEM CONTROL TEMPLATE   -->
    <!-- ********************************* -->

    <Style x:Key="LoopingSelectorStyle" TargetType="toolkitPrimitives:LoopingSelector">
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="IsExpanded" Value="True" />
        <Setter Property="ItemTemplate" Value="{StaticResource LoopingSelectorDataTemplate}" />
    </Style>
    
    <DataTemplate x:Key="StatsPanoramaHeaderDataTemplate">
    	<Grid/>
    </DataTemplate>
    
    <Style x:Key="StatsPanoramaStyle" TargetType="controls:Panorama">
    	<Setter Property="ItemsPanel">
    		<Setter.Value>
    			<ItemsPanelTemplate>
    				<controlsPrimitives:PanoramaPanel x:Name="panel"/>
    			</ItemsPanelTemplate>
    		</Setter.Value>
    	</Setter>
    	<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
    	<Setter Property="Background" Value="Transparent"/>
    	<Setter Property="Template">
    		<Setter.Value>
    			<ControlTemplate TargetType="controls:Panorama">
    				<Grid>
    					<Grid.RowDefinitions>
    						<RowDefinition Height="auto"/>
    						<RowDefinition Height="*"/>
    					</Grid.RowDefinitions>
    					<controlsPrimitives:PanningBackgroundLayer x:Name="BackgroundLayer" HorizontalAlignment="Left" Grid.RowSpan="2">
    						<Border x:Name="background" Background="{TemplateBinding Background}" CacheMode="BitmapCache"/>
    					</controlsPrimitives:PanningBackgroundLayer>
    					<controlsPrimitives:PanningTitleLayer x:Name="TitleLayer" CacheMode="BitmapCache" ContentTemplate="{TemplateBinding TitleTemplate}" Content="{TemplateBinding Title}" FontSize="160" FontFamily="{StaticResource PhoneFontFamilyLight}" HorizontalAlignment="Left" Margin="8,-55,0,0" Grid.Row="0" Height="185" VerticalAlignment="Top"/>
    					<controlsPrimitives:PanningLayer x:Name="ItemsLayer" HorizontalAlignment="Left" Grid.Row="1">
    						<ItemsPresenter x:Name="items"/>
    					</controlsPrimitives:PanningLayer>
    				</Grid>
    			</ControlTemplate>
    		</Setter.Value>
    	</Setter>
    </Style>

    <Style x:Key="THCTextBoxTemplate" TargetType="TextBox">
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}" />
        <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}" />
        <Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource PhoneTextBoxBrush}" />
        <Setter Property="SelectionBackground" Value="{StaticResource PhoneAccentBrush}" />
        <Setter Property="SelectionForeground" Value="{StaticResource PhoneTextBoxSelectionForegroundBrush}" />
        <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}" />
        <Setter Property="Padding" Value="2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledOrReadonlyBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ReadOnly">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledOrReadonlyBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledOrReadonlyBorder" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledOrReadonlyBorder" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledOrReadonlyContent" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxReadOnlyBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledBorder" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxEditBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledBorder" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxEditBorderBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="EnabledBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <ContentControl x:Name="ContentElement" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" BorderThickness="0"
                                                FontSize="18.667"
                                                Padding="{TemplateBinding Padding}" />
                        </Border>
                        <Border x:Name="DisabledOrReadonlyBorder" Background="Transparent"
                                    BorderBrush="{StaticResource PhoneDisabledBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Visibility="Collapsed">
                            <TextBox x:Name="DisabledOrReadonlyContent" Background="Transparent"
                                         FontFamily="{TemplateBinding FontFamily}"
                                         FontSize="{TemplateBinding FontSize}"
                                         FontStyle="{TemplateBinding FontStyle}"
                                         FontWeight="{TemplateBinding FontWeight}"
                                         Foreground="{StaticResource PhoneDisabledBrush}"
                                         IsReadOnly="True"
                                         SelectionBackground="{TemplateBinding SelectionBackground}"
                                         SelectionForeground="{TemplateBinding SelectionForeground}"
                                         Template="{StaticResource PhoneDisabledTextBoxTemplate}"
                                         Text="{TemplateBinding Text}"
                                         TextAlignment="{TemplateBinding TextAlignment}"
                                         TextWrapping="{TemplateBinding TextWrapping}" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>